import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

// https://vitejs.dev/config/
export default defineConfig({
  base: '/',
  define: {
    React: 'React',
    ReactDOM: 'ReactDOM',
  },
  server: {
    host: true,
    proxy: {
      '/api': {
        target: 'http://localhost:4003',
        // pathRewrite: { '^/api': '' },
        changeOrigin: true,
      },
      '/components': {
        target: 'http://localhost:4003',
        changeOrigin: true,
      },
    },
  },
  plugins: [react()],
})
